<?php
/**
 * TomatoCMSo
 *
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 *
 * @copyright    Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license        http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version     $Id: Attribute.php 2793 2010-05-03 18:48:14Z huuphuoc $
 * @since        2.0.5
 */

interface Shop_Models_Interface_Evaluation
{
    /**
    * Get Evaluation by id
    * @param array $exp Array condition
    * @return void
    **/
    public function getById($exp = null);

    /**
     * Add evaluation
     * @param Shop_Models_Evaluation $evaluation
     * @return void
    **/
    public function add($evaluation);

    /**
     * Update evaluation
     * @param Shop_Models_Evaluation $evaluation
     * @return void
    **/
    public function update($evaluation, $buyer=true);

    /**
     * Update evaluation and counter for enterprise
     * @param array $evaluationEnt
     * @return void
    **/
    public function updateEnt($evaluationEnt);

    /**
     * Update evaluation and counter for customer
     * @param array $evaluationCus
     * @return void
    **/
    public function updateCus($evaluationCus);

    /**
     * Get evaluation by user or enterprise id
     * @param array $exp
     * @return Tomato_Model_Recordset
    **/
    public function getByEU($offset, $count, $exp = null);

    /**
     * Count evaluation
     * @param array $exp
     * @return int
    **/
    public function countEU($exp = null);

    /**
     * Sum evaluation
     * @param array $exp
     * @param bool $buyer
     * @return int
    **/
    public function sum($exp = null, $buyer = true);
    
    /**
     * Get order has been feedback
     *
     * @param array $exp
     * @param int $offset
     * @param int $count
     */
    public function orderEval($exp = null, $offset = 0, $count = 0);
    
    /**
     * Count evaluation
     * @param array $exp
     * @return int
    */
    public function counOrderEval($exp = null);
}
